declare sub fileLineCount(file as string)
declare sub fileLoad(file as string, text() as string)
dim fileName as string
    dim fileText() as string
    dim  shared count as integer

'ScreenRes 1280, 1024, 8
screen _newimage(1024, 768, 32)
blank& = _LOADIMAGE("blank.png")
i& = _LOADIMAGE("test.png")
screenImage& = _NEWIMAGE(1024, 768, 32)
_PUTIMAGE (20,20), i&
fileName = "test.txt"

    fileLineCount(fileName$)
    redim fileText$(count)
    call fileLoad (fileName$,fileText$())

    print "file stuffs"
    print "file text size line 2 = ", fileText$(2)
    dim x as integer
	dim xPos as INTEGER
	startTime! = TIMER
	oldTime! = timer
	print startTime!
	x = 0
	xPos = 0
    do while x < 1 
	currentTime! = timer	
	
	changeInTime! = currentTime! - oldTime!
	'print currentTime!
'	print "changeInTime! = ", changeInTime!
	if changeInTime! >= .10 then 
'		print currentTime!
		oldTime! = currentTime! 
		xPos = xPos + 10
'		print "xPos =", xPos
		
	end if
		_PUTIMAGE , blank&, screenImage&
        _PUTIMAGE (xPos,0), i&, screenImage&
		_PUTIMAGE (0,0), screenImage&
    loop

    sleep



sub fileLineCount(file as string)
    dim lin as string
    count = 0
    open file$ for INPUT as #1
    do while not eof(1)
        line input #1, lin$
        count = count + 1
'        print lin$
    loop
    close #1
end sub

sub fileLoad (file as string, text() as string)
    print count
    dim i as integer
    open file$ for INPUT as #1
        i = 1
        DO WHILE NOT EOF(1)
            line input #1, text$(I)
            i = i + 1
            print i
        LOOP
        close #1

'    print line$(1)
'    dim test$(2)
'    test$(1) = "fleee"
'    PRINT "DEE"
'    print test$(1)
'    REDIM _PRESERVE test$(6)
'    print "doo"
'    PRINT test$(1)

end sub
